import _Fetch from '@/server/Fetch'
import { API_POST_QUERY_KEYWORDS, API_POST_QUERY_COURSE_KEYWORDS } from '@/api/home/queryList'

export async function get_query_data(keyword: string, pageNum: number, pageSize: number, type: string) {
  console.log(type)

  if (type === 'test') {
    // 测试题
    return await _Fetch(API_POST_QUERY_KEYWORDS, {
      keyword: keyword || '',
      pageNum,
      pageSize,
    })
  } else {
    // 课程
    return await _Fetch(API_POST_QUERY_COURSE_KEYWORDS, {
      keyword: keyword || '',
      pageNum,
      pageSize,
    })
  }
}
